<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/commons/inc.jsp" %>

<h3 id="navTitleId">运动治疗</h3>

<body id="body">

<%@include file="/commons/showmessage.jsp" %>

<form name="sportform" id="sportform" method="post" action="${contextPath}/sport/sport.action?method=saveEditSportsTreat">
	<s:hidden name="sportsTreat.seqid" id="sportsTreat.seqid"></s:hidden>
	<s:hidden name="sportsTreat.patientid" id="sportsTreat.patientid"></s:hidden>
	<s:hidden name="patientid" id="patientid"></s:hidden>
	 
	<table border="0" cellspacing="1" cellpadding="0" class="formTable" width="100%" >
	<tbody>
		<tr>
			<td align="left" class="form-td"><label class="label">开始时间</label></td>
			<td align="left" class="form-td" colspan="3"><input type="text"  class="Wdate" size="15" value="${sportsTreat.starttime}" onClick="WdatePicker()" name="sportsTreat.starttime" id="sportsTreat.starttime"/></td>
			<td align="left" class="form-td"><label class="label">结束时间</label></td>
			<td align="left" class="form-td" colspan="3"><input type="text"  class="Wdate" size="15" value="${sportsTreat.endtime}" onClick="WdatePicker()" name="sportsTreat.endtime" id="sportsTreat.endtime"/></td>
		</tr>
		
		<tr>
			<td align="left" class="form-td"><label class="label">运动锻炼形式</label></td>
			<td align="left" class="form-td"><input type="text" name="sportsTreat.sporttype" id="sportsTreat.sporttype" size="5" value="${sportsTreat.sporttype}"/></td>
			<td align="left" class="form-td"><label class="label">运动锻炼频率</label></td>
			<td align="left" class="form-td"><input type="text" name="sportsTreat.sportsfreq" id="sportsTreat.sportsfreq" size="5" value="${sportsTreat.sportsfreq}"/>次/周</td>
			<td align="left" class="form-td"><label class="label">运动锻炼时间</label></td>
			<td align="left" class="form-td"><input type="text" name="sportsTreat.sportstime" id="sportsTreat.sportstime" size="5" value="${sportsTreat.sportstime}"/>分钟/次</td>
			<td align="left" class="form-td"><label class="label">每次耗能</label></td>
			<td align="left" class="form-td"><input type="text" name="sportsTreat.energy" id="sportsTreat.energy" size="5" value="${sportsTreat.energy}"/>千卡</td>
		</tr>
	</tbody>
	</table>
	<table>
		<tr>
			<td align="center">
			<input type="reset" value="重置">
		    <input type="button" onclick="saveEdit('save');" value="保存"></td>
		</tr>
	</table>
</form>

<%@include file="/commons/tableSel.jsp" %>

</body>

<style type="text/css">
body {
	height: 100%;
	width: 100%;
}
</style>

<script>
function saveEdit(type){
	if(type=='refresh'){
		location.reload();
	}else if(type=='save'){
		if(!Validator.Validate($('sportform'),3)){
			return;
		}	
		var a = $('sportsTreat.starttime').value;
		var b = $('sportsTreat.endtime').value;

		if(a && b && a!="" && b!=""){
			if(a>b){
				alert("结束时间不能小于开始时间");
				return;
			}
		}
		$('sportform').submit();
	}
}
</script>